Service Monitor

Plasma 4 Extensions

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

14
Become a Fan
8.3

Description:
Distribution-independent utility for monitoring/toggling background services (daemons).

Features: show current status of services; start/stop with a single click; placeable on desktop or in dock;
maximum flexibility through shell commands

Installation: plasmapkg -i service-monitor.zip

Submit bugs and feature requests on GitHub: https://github.com/mbleichner/service-monitor/issues

You are welcome to contribute to development, feel free to create a fork on GitHub!

New Features in v2.0:
- Password input dialog now included (no more dependency on external tools like kdesudo)
- Easier management of service definition files (incl. one-click update)
- Hide unavailable services
- Environment variables aren't needed any more ($INITDIR will be guessed, $SUDO has become superfluous)
- Ability to copy existing services as custom services
- Sudo configuration helper (creates snippets for inclusion in /etc/sudoers)
- Three different indicator icon themes
- Option to suppress stdout of start/stop commands
- Report external state changes through KNotify
- Service icons can be placed directly in the panel (without popup)

Ratings & Comments

72 Comments

brucew

The 2.0 link downloads 1.1.3.x Please advise.

skatox

It's not working on KDE 4.10 :( it crash plasma.

Smokematic

Thank you for this great plasmoid i have been using it for a while and it has been a great experience! It whould be great if we could use the plasmoid for remote services too (via ssh???) or wake a remote system (WOL). Tnx again, keep up the good work!

skylord

One of my favorite plasmoids, but since a Python-KDE4 upgrade on SuSE 11.4/KDE 4.8.5 this morning, V2RC2 barfs up with a "RuntimeError: the sip module implements API v9.0 but the PyKDE4.plasma module requires API v8.1" error. Before this upgrade also crashed my plasma desktop with unversioned something errors.

mbleichner

Are you still having this issue? Can you give some more precise information?

skylord

The problem went away this morning when I installed an updated Python Bindings for KDE4-package from the SuSE KDE 4.8 builds repository.

mbleichner

Glad to hear this. I once had a similar problem with delayed upgrades for python bindings. Was really annoying...

s1300045

This is probably the most useful plasma utility I've come across so far! Keep up the good work!

elric77

This is really a great app! But I don't get a pop up, when I put it in the panel (it just shows the upmost icon and description of the list). What could be the reason for this? I would really appreciate to use it, if this could be solved...

elric77

solved...

mbleichner

Sorry for the late answer, I haven't been at home. What was the cause?

grisse

Hi wollte das script verwenden aber leider funzt es nicht. Habe opensuse 12 und beim starten kommmt die Fehlermeldeung dass es ein Python script brauht. Weist du zufällig welches Paket ich zusätzlich installieren muß ? danke wäre super denn das Script könnte ich gut brauchen lg chris

mbleichner

Unter Debian muss "plasma-scriptengine-python" installiert sein, bei suse müsste es dasselbe oder was ähnliches geben. Falls es das nicht war, welche Fehlermeldung bekommst du?

grisse

also als Fehlermeldung kommt bei mir: "Der python-skript Treiber für Service Monitor kann nicht installiert werden" Jetzt weis ich nicht in welchem Packet der drinnen ist kannst du mir da weiterhelfen ?

mbleichner

Puh, das wird vermutlich schon die Plasma Scriptengine für Python sein. Aber ich weiß nicht, was für ein Paket man da unter SuSE installieren muss. Hast du mal geschaut, ob es ein Paket "plasma-scriptengine-python" gibt?

DavidEdmundson

This is one of the most polished well designed plasmoids I've seen. You should try and get it into KDE extragear.

rdonato

You should change mysqld job detection: it fails on kde because akonadi uses mysqld for its embedded db. I added a new service for akonadi mysqld job and a new check for running jobs.

<service id="mysql-daemon for kde env" priority="0">
    <name>MySQL Database</name>
    <description>Database server used by many programs (stopping could be a bad idea)</description>
    <installcheck>ls $INITDIR/mysql</installcheck>
    <runningcheck>ps fax|grep mysqld|grep "akonadi"|cut -d"?" -f1|grep -v grep</runningcheck>
    <startcommand>$SUDO $INITDIR/mysql start</startcommand>
    <stopcommand>$SUDO $INITDIR/mysql stop</stopcommand>
  </service>
  
  <service id="mysql-daemon" priority="0">
    <name>MySQL Database</name>
    <description>Database server used by many programs (stopping could be a bad idea)</description>
    <installcheck>ls $INITDIR/mysql</installcheck>
    <runningcheck>ps fax|grep mysqld|grep -v "akonadi"|cut -d"?" -f1|grep -v grep</runningcheck>
    <startcommand>$SUDO $INITDIR/mysql start</startcommand>
    <stopcommand>$SUDO $INITDIR/mysql stop</stopcommand>
  </service>

rdonato

Humm I was wrong..you are expecting an exit code from the check...I fixed it adding a custom shell script for mysql process (put it in your path):

#!/bin/sh
SERVICE=$1
if [ "$SERVICE" = "akonadi" ]
then 
 if ps fax | grep -v grep | grep "mysqld" | grep $SERVICE > /dev/null
 then
     echo "$SERVICE service running, bye bye"
     exit 0
 else
     echo "$SERVICE is not running"
     exit 1
 fi
else 
 if ps fax | grep -v grep | grep "mysqld" | grep -v "akonadi" > /dev/null
 then 
     echo "Mysqld service running, bye bye"
     exit 0
 else 
    echo "$SERVICE is not running"
    exit 1 
 fi   
fi
And daemons-common.xml:
<service id="mysql-daemon for kde env" priority="0">
    <name>MySQL Database for KDE Env</name>
    <description>Database server used by kde (stopping could be a bad idea)</description>
    <installcheck>ls $INITDIR/mysql</installcheck>
    <runningcheck>pidofmysql.sh akonadi</runningcheck>
    <startcommand>$SUDO $INITDIR/mysql start</startcommand>
    <stopcommand>$SUDO $INITDIR/mysql stop</stopcommand>
  </service>
  
  <service id="mysql-daemon" priority="0">
    <name>MySQL Database</name>
    <description>Database server</description>
    <installcheck>ls $INITDIR/mysql</installcheck>
    <runningcheck>pidofmysql.sh mysql</runningcheck>
    <startcommand>$SUDO $INITDIR/mysql start</startcommand>
    <stopcommand>$SUDO $INITDIR/mysql stop</stopcommand>
  </service>

mbleichner

Thank you for the suggestions! Actually, it seems you were thinking a bit too complicated. The following commands seem to work fine: show non-akonadi process: ps ax | grep "/usr/sbin/mysqld" | grep -v grep| grep -v akonadi show akonadi process: ps ax | grep "/usr/sbin/mysqld" | grep -v grep| grep akonadi Can you check if they work correctly? Then I'll include them into the official sources.

rdonato

Hi, humm...I think it fails because you are going to expect a return code from the test....that's why i used a custom shell script to check mysql instances.

mbleichner

The return code is irrelevant if the commands are syntactically correct and produce no errors. So for the check to succeed it must only produce non-empty output.

rdonato

May be I am wrong..but you are using "proc.exitCode()" and your original check calls pidof which returns an exit code. Running ps returns everytime 0. That's why your check fails...from pidof man: EXIT STATUS 0 At least one program was found with the requested name. 1 No program was found with the requested name.

mbleichner

That may be right, but pidof also produces no output if the given process cannot be found. For a check to fail, it is sufficient to return non-zero exit code OR zero output. For a check to succeed, it must return exit code zero AND non-empty output. Besides, on second thought it makes little to define a service for the akonadi MySQL process, because there is no shutdown possibility other than killing the server or akonadi itself. For akonadi there is already a service defined, and killing the MySQL process right under Akonadi's nose seems a bad idea to me.

Epimetheus11

Occasionally I want to turn the screen off while leaving the laptop/desktop running in the background. This example service makes it a single button click: DPMS Turn the screen off/on Install check: which xset Running check: xset q | grep "DPMS is Enabled" Start command: xset dpms force on Stop command: xset dpms force off

mbleichner

Thank you very much. I have included the definitions in the tools & settings file.

Pling
0 Affiliates
Details
license
version 2.0
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 2

More Plasma 4 Extensions from mbleichner:

SmartNotify (unobtrusive notifications)
mbleichner
last update date: 15 years ago

Score 8.1

Other Plasma 4 Extensions:

Icon Tasks deb build
N00bun2
last update date: 14 years ago

Score 4.3

Prayer Times Plasmoid
riyad
last update date: 13 years ago

Score 5.2

KPrayertime4 Islamic Prayer Times
ahaq
last update date: 15 years ago

Score 4.4

Hostinfo
mgraesslin
last update date: 13 years ago

Score 4.7

Monitor QuadCore Russian
kuchumovn
last update date: 16 years ago

Score 5.0

blaKjaK
werevire
last update date: 15 years ago

Score 5.0